<script type="text/template" id="template-kind-kindPage">
    <div class="MainContainer beanPageView kind">
        <el-row class="breadcrumb">
            <el-breadcrumb separator-class="el-icon-arrow-right">
                <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
                <el-breadcrumb-item>分类列表</el-breadcrumb-item>
            </el-breadcrumb>
        </el-row>
        <el-row class="tool-bar">
            <el-col :span="9" :offset="1">
                <el-button size="small" icon="el-icon-refresh" onclick="location.reload()">刷新</el-button>
                <el-button size="small" type="primary" icon="el-icon-plus" @click="goBeanPage(null)">新增</el-button>
            </el-col>
            <el-col :span="5" :offset="7">
                <el-input size="small" prefix-icon="el-icon-search" v-model="fullTextSearchValue" placeholder="搜索"></el-input>
            </el-col>
            <el-col :span="1">
                <el-button size="small" type="primary" @click="pageNum=1;select()">搜索</el-button>
            </el-col>
        </el-row>
        <el-table class="table" max-height="510" :data="beans" size="small"
            stripe border @sort-change="changeOrder">
            <el-table-column
                    label=" "
                    type="index">
            </el-table-column>
            <el-table-column sortable="custom" min-width="150px"
                label="类型"
                prop="type">
            </el-table-column>
            <el-table-column sortable="custom" min-width="150px"
                label="编号"
                prop="code">
            </el-table-column>
            <el-table-column sortable="custom" min-width="150px"
                label="名称"
                prop="name">
            </el-table-column>
            <el-table-column sortable="custom" min-width="150px"
                label="叶子节点"
                prop="isLeaf">
            </el-table-column>
            <el-table-column sortable="custom" min-width="150px"
                label="启用"
                prop="enable">
            </el-table-column>
            <el-table-column sortable="custom" min-width="150px"
                label="状态"
                prop="status">
            </el-table-column>
            <el-table-column sortable="custom" min-width="110px" :formatter="dateFormat"
                label="创建时间"
                prop="createTime">
            </el-table-column>
            <el-table-column sortable="custom" min-width="150px"
                label="创建者"
                prop="creator">
            </el-table-column>
            <el-table-column sortable="custom" min-width="110px" :formatter="dateFormat"
                label="更新时间"
                prop="updateTime">
            </el-table-column>

            <el-table-column
                    fixed="right"
                    label="操作"
                    width="170">
                <template slot-scope="scope">
                    <el-button-group>
                        <el-button icon="el-icon-edit" @click="goBeanPage(scope.row.id)" type="primary"
                                   size="mini">查看
                        </el-button>
                        <el-button icon="el-icon-delete" @click="deleteBean(scope.row.id)" type="danger"
                                   size="mini">删除
                        </el-button>
                    </el-button-group>
                </template>
            </el-table-column>
        </el-table>
        <el-row class="pagination">
                <el-pagination
                        prev-text="上一页"
                        next-text="下一页"
                        @size-change="select"
                        :current-page.sync="pageNum"
                        :page-sizes="[10, 20, 50, 100]"
                        :page-size="pageSize"
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="totalRecordNum">
                </el-pagination>
        </el-row>
    </div>
</script>
<script type="application/javascript">
    templateName = "kind-kindPage";
    templates[templateName] = Vue.extend({
        template: '#template-' + templateName,
        data: function () {
            var data=solar.copyObject(solar.baseData);
            data.beanName="kind";
            return data;
        },
        methods: {
            select: solar.baseMethods.selectPage,
            checkedAll: solar.baseMethods.checkedAll,
            deleteBean: solar.baseMethods.deleteBean,
            deleteBeans: solar.baseMethods.deleteBeans,
            changeEnable: solar.baseMethods.changeEnable,
            goBeanPage: solar.baseMethods.goBeanPage,
            goUpdatePage: solar.baseMethods.goUpdatePage,
            changeOrder: solar.baseMethods.changeOrder,
            dateFormat: solar.baseMethods.dateFormat,
        },
        mounted: function () {
            this.select();
        },
        watch: {
            'pageNum':{
                handler: function (val, oldVal) {
                    this.select();
                }
            },
        }
    });
</script>